﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once

#include "GcmpCommandAction.h"
#include "IObject.h"

namespace gcmp
{
    class IElement;
    class IMenuItemDefinition;

    /// \brief 右键菜单管理接口类。
    FINAL_INTERFACE class GCMP_COMMAND_ACTION_EXPORT ICustomizeShortcutMenuManager
    {
    public:
        /// \brief 获取当前的右键菜单管理对象
        /// \return ICustomizeShortcutMenuManager* 当前的右键菜单管理对象指针
        static ICustomizeShortcutMenuManager* Get();

        /// \brief 读取自定义右键菜单配置文件
        /// \param configurationFolderName 配置文件所在的文件夹名，文件名默认为"CustomizeShortcutMenu.xml"
        /// \return false-读取出错， true-读取成功
        virtual bool ReadCustomizeShortcutMenu(const std::wstring& configurationFolderName) = 0;

        /// \brief 根据元素获取对应的右键菜单定义
        /// \param pElement 右键菜单对应的元素
        /// \return 右键菜单定义数组
        virtual std::vector<OwnerPtr<IMenuItemDefinition>> GetShortcutMenuData(const IElement* pElement) = 0;

        /// \brief 获取未选中任何元素时的右键菜单定义
        /// \return 右键菜单定义数组
        virtual std::vector<OwnerPtr<IMenuItemDefinition>> GetShortcutMenuNoSelectData() = 0;

        /// \brief 获取默认的右键菜单定义
        /// \return 右键菜单定义数组
        virtual std::vector<OwnerPtr<IMenuItemDefinition>> GetDefaultShortcutMenuData() = 0;

    public:
        virtual ~ICustomizeShortcutMenuManager() = 0;
    };
}

